<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<div id="content">
    <%--<ul>
        <c:forEach var="contract" items="${contracts}">
            <li>
                <a href="${pageContext.request.contextPath}/client/${contract.idClient}/contract/${contract.idContract}/edit.do">${contract.idContract} ${contract.maxBorrow} ${contract.status}</a>
                <a style="color: red; margin-left: 20px" href="${pageContext.request.contextPath}/client/${contract.idClient}/contract/${contract.idContract}/delete.do">delete</a>
            </li>
        </c:forEach>
    </ul>--%>
    <table class="table table-hover">
        <tr>
            <td>Id_contract</td><td>Product</td><td>Start date</td><td>Max borrow</td><td>Status</td><td></td>
        </tr>
        <c:forEach var="contract" items="${contracts}">
            <tr>
                <td><a href="${pageContext.request.contextPath}/client/${contract.idClient}/contract/${contract.idContract}/edit.do">${contract.idContract}</a></td>
                <td>${contract.idProduct}</td>
                <td><fmt:formatDate pattern="yyyy-MM-dd" value="${contract.startDate}"/></td>
                <td>${contract.maxBorrow}</td>
                <td><c:if test="${contract.status > 0}">active</c:if><c:if test="${contract.status == 0}">inactive</c:if></td>
                <td><a style="color: red;" href="${pageContext.request.contextPath}/client/${contract.idClient}/contract/${contract.idContract}/delete.do">delete</a></td>
            </tr>
        </c:forEach>
    </table>

</div>
<div><a style="margin-left: 30px" href="${pageContext.request.contextPath}/client/${clientId}/contract/0/edit.do">
    Add new contract</a></div>
</body>
</html>